-
-
Notifications
You must be signed in to change notification settings - Fork 702
[FIX] stock_picking_batch_validate_confirm: avoid propagating context with defaults #1870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] stock_picking_batch_validate_confirm: avoid propagating context with defaults #1870
Conversation
Hi @rafaelbn, @EmilioPascual, |
… with defaults When this module was installed along with `sale_elaboration`, elaboration sale order lines could be created automatically when confirming a picking. The `sale.order.line` model also has a `move_ids` field. Thus, those lines were created associated to the `stock.move` records found from within the batch. To make it even more fun, a batch can contain moves associated to unrelated sales. Thus, the elaboration lines were getting stock moves (which is wrong because they are services) and those moves came from unrelated sale orders. This mismatch was resulting in unexpected behaviors here and there. Now, we just produce defaults based on the standard context that all wizards get by default. This is safe and doesn't pollute any sub-calls. @moduon MT-9033 MT-7490
95c532a
to
2a687be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Code review
/ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at aca7f45. Thanks a lot for contributing to OCA. ❤️ |
When this module was installed along with
sale_elaboration
, elaboration sale order lines could be created automatically when confirming a picking.The
sale.order.line
model also has amove_ids
field. Thus, those lines were created associated to thestock.move
records found from within the batch.To make it even more fun, a batch can contain moves associated to unrelated sales. Thus, the elaboration lines were getting stock moves (which is wrong because they are services) and those moves came from unrelated sale orders.
This mismatch was resulting in unexpected behaviors here and there.
Now, we just produce defaults based on the standard context that all wizards get by default. This is safe and doesn't pollute any sub-calls.
@moduon MT-9033 MT-7490